package kuangshen.start;

/**
 * @program: liangt
 * @description: 推导函数式表达式
 * @author: liangt
 * @create: 2021-03-01 13:23
 */
public class TestLamdbaOne {


    /**
     * 静态内部类
     */
    static class Like2 implements ILike{

        @Override
        public void ilike() {
            System.out.println("Like2");
        }
    }
    public static void main(String[] args) {
        ILike like = new Like();
        like.ilike();
        like = new Like2();
        like.ilike();

        //局部内部类
        class Like3 implements ILike{

            @Override
            public void ilike() {
                System.out.println("Like3");
            }
        }
        like = new Like3();
        like.ilike();

        //匿名内部类
        like = new ILike() {
            @Override
            public void ilike() {
                System.out.println("Like4");
            }
        };
        like.ilike();

        like = ()->{
            System.out.println("Like5");
        };
        like.ilike();
        int _aa = 0;
        Ec e= new Ec();
        Ec.Eb eb = e.new Eb();
        Ec.Eb eb1 = new Ec().new Eb();

    }
}

//抽象接口
interface ILike{
    //默认抽象
    public abstract void ilike();
}

//内部类实现类
class Like implements ILike{

    @Override
    public void ilike() {
        System.out.println("Like1");
    }
}

class Ec{
    public class  Eb{}
}

